package com.itheima.tlias.controller;


import com.itheima.tlias.dto.LoginDto;
import com.itheima.tlias.service.EmpService;
import com.itheima.tlias.vo.LoginVo;
import com.itheima.tlias.vo.Result;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 登录Controller
 */
@Slf4j
@RestController
public class LoginController {

    @Autowired
    private EmpService empService;

   // @MyComment(desc = "登录接口")
    @PostMapping("/login")
    public Result<LoginVo> login(@RequestBody LoginDto dto) {
        //log.info("员工进行登录了..... ");
        LoginVo loginInfo = empService.login(dto);
        return Result.success(loginInfo);

    }
}
